﻿<%@ Page Language="C#" ViewStateMode="Disabled" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    protected void Page_Load(Object sender, EventArgs e)
    {
        var data = new object[]
        {
             new { ProductId=1, Name="Chai" },
             new { ProductId=2, Name="Tea" },
             new {ProductId=3, Name="Coffee"}
        };

        this.ListView1.DataSource = data;
        this.ListView1.DataBind();
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ListView ID="ListView1"  runat="server"
            ClientIDMode="Predictable" ClientIDRowSuffix="ProductID">
            <ItemTemplate>
                ProductID:
                <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' />
                <br />
                ProductName:
                <asp:Label ID="ProductNameLabel" runat="server" Text='<%# Eval("Name") %>' />
                <br />
                <br />
            </ItemTemplate>
            <LayoutTemplate>
                <div id="itemPlaceholderContainer" runat="server">
                    <span id="itemPlaceholder" runat="server" />
                </div>
                <div>
                </div>
            </LayoutTemplate>
        </asp:ListView>
    </div>
    </form>
</body>
</html>
